package cn.melon.mod.roll;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * RollInfo.java.
 * 学籍管理实体类
 * @author corvo
 * @date Aug 26, 2016
 */
public class RollInfo {

	/**
	 * 学号
	 */
    private String studentNumber; 
    /**
     * 姓名
     */
    private String name;
    /**
     * 一卡通号
     */
    private String cardNum; 
    /**
     * 性别
     */
    private String sex;
    /**
     * 民族
     */
    private String nation; 
    /**
     * 政治面貌
     */
    private String politicalStatus; 
    /**
     * 婚姻状况
     */
    private String maritalStatus;
    /**
     * 身份证/港澳通行证
     */
    private String idCard;
    /**
     * 出生日期
     */
    private String dateBirth;
    /**
     * 籍贯
     */
    private String nativePlace;
    /**
     * 家庭住址
     */
    private String address;
    /**
     * 校区
     */
    private String curCampus;
    /**
     * 院系
     */
    private String department;
    /**
     * 专业
     */
    private String major;
    /**
     * 年级
     */
    private String curGrade;
    /**
     * 班级
     */
    private String curClass;
    /**
     * 学制
     */
    private String length;
    /**
     * 手机号码
     */
    private String phone;
    /**
     * 电子邮箱
     */
    private String email;
    /**
     * 个性签名
     */
    private String sign;
    /**
     * 更新日期
     */
    private String updateDate;
    
    public static RollInfo toInfo(JSONObject jInfo) throws JSONException {
        
        RollInfo rollInfo = new RollInfo();
        rollInfo.setStudentNumber(jInfo.getString("studentNumber"));
        rollInfo.setName(jInfo.getString("name"));
        rollInfo.setCardNum(jInfo.getString("cardNum"));
        rollInfo.setSex(jInfo.getString("sex"));
        rollInfo.setNation(jInfo.getString("nation"));
        rollInfo.setPoliticalStatus(jInfo.getString("politicalStatus"));
        rollInfo.setMaritalStatus(jInfo.getString("maritalStatus"));
        rollInfo.setIdCard(jInfo.getString("idCard"));
        rollInfo.setDateBirth(jInfo.getString("dateBirth"));
        rollInfo.setNativePlace(jInfo.getString("nativePlace"));
        rollInfo.setAddress(jInfo.getString("address"));
        rollInfo.setCurCampus(jInfo.getString("curCampus"));
        rollInfo.setDepartment(jInfo.getString("department"));
        rollInfo.setMajor(jInfo.getString("major"));
        rollInfo.setCurGrade(jInfo.getString("curGrade"));
        rollInfo.setCurClass(jInfo.getString("curClass"));
        rollInfo.setLength(jInfo.getString("length"));
        rollInfo.setPhone(jInfo.getString("phone"));
        rollInfo.setEmail(jInfo.getString("email"));
        rollInfo.setSign(jInfo.getString("sign"));
        rollInfo.setUpdateDate(jInfo.getString("updateDate"));

        return rollInfo;
    }
    
    public JSONObject toJSON() throws JSONException {
        JSONObject jInfo = new JSONObject();
        jInfo.put("studentNumber", getStudentNumber());
        jInfo.put("name", getName());
        jInfo.put("cardNum", getCardNum());
        jInfo.put("sex", getSex());
        jInfo.put("nation", getNation());
        jInfo.put("politicalStatus", getPoliticalStatus());
        jInfo.put("maritalStatus", getMaritalStatus());
        jInfo.put("idCard", getIdCard());
        jInfo.put("dateBirth", getDateBirth());
        jInfo.put("nativePlace", getNativePlace());
        jInfo.put("address", getAddress());
        jInfo.put("curCampus", getCurCampus());
        jInfo.put("department", getDepartment());
        jInfo.put("major", getMajor());
        jInfo.put("curGrade", getCurGrade());
        jInfo.put("curClass", getCurClass());
        jInfo.put("length", getLength());
        jInfo.put("phone", getPhone());
        jInfo.put("email", getEmail());
        jInfo.put("sign", getSign());
        jInfo.put("updateDate", getUpdateDate());

        return jInfo;
    }
    
    
    public RollInfo() {
        
    }

    public RollInfo(String studentNumber, String name, String cardNum, String sex, String nation, String politicalStatus, 
    		String maritalStatus, String idCard, String dateBirth, String nativePlace, String address, 
    		String curCampus, String department, String major, String curGrade, String curClass,
    		String length, String phone, String email, String sign, String updateDate) {
        this.studentNumber = studentNumber;
        this.name = name;
        this.cardNum = cardNum;
        this.sex = sex;
        this.nation = nation;
        this.politicalStatus = politicalStatus;
        this.maritalStatus = maritalStatus;
        this.idCard = idCard;
        this.dateBirth = dateBirth;
        this.nativePlace = nativePlace;
        this.address = address;
        this.curCampus = curCampus;
        this.department = department;
        this.major = major;
        this.curGrade = curGrade;
        this.curClass = curClass;
        this.length = length;
        this.phone = phone;
        this.email = email;
        this.sign = sign;
        this.updateDate = updateDate;

    }
    public String getStudentNumber() {
        return studentNumber;
    }
    public void setStudentNumber(String studentNumber) {
        this.studentNumber = studentNumber;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getCardNum() {
        return cardNum;
    }
    public void setCardNum(String cardNum) {
        this.cardNum = cardNum;
    }
    public String getSex() {
        return sex;
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
    public String getNation() {
        return nation;
    }
    public void setNation(String nation) {
        this.nation = nation;
    }
    public String getPoliticalStatus() {
        return politicalStatus;
    }
    public void setPoliticalStatus(String politicalStatus) {
        this.politicalStatus = politicalStatus;
    }
    public String getMaritalStatus() {
        return maritalStatus;
    }
    public void setMaritalStatus(String maritalStatus) {
        this.maritalStatus = maritalStatus;
    }
    public String getIdCard() {
        return idCard;
    }
    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }
    public String getDateBirth() {
        return dateBirth;
    }
    public void setDateBirth(String dateBirth) {
        this.dateBirth = dateBirth;
    }
    public String getNativePlace() {
        return nativePlace;
    }
    public void setNativePlace(String nativePlace) {
        this.nativePlace = nativePlace;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public String getCurCampus() {
        return curCampus;
    }
    public void setCurCampus(String curcampus) {
        this.curCampus = curcampus;
    }
    public String getDepartment() {
        return department;
    }
    public void setDepartment(String department) {
        this.department = department;
    }
    public String getMajor() {
        return major;
    }
    public void setMajor(String major) {
        this.major = major;
    }
    public String getCurGrade() {
        return curGrade;
    }
    public void setCurGrade(String curCrade) {
        this.curGrade = curCrade;
    }
    public String getCurClass() {
        return curClass;
    }
    public void setCurClass(String curClass) {
        this.curClass = curClass;
    }
    public String getLength() {
        return length;
    }
    public void setLength(String length) {
        this.length = length;
    }
    public String getPhone() {
        return phone;
    }
    public void setPhone(String phone) {
        this.phone = phone;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public String getSign() {
        return sign;
    }
    public void setSign(String sign) {
        this.sign = sign;
    }
    public String getUpdateDate() {
        return updateDate;
    }
    public void setUpdateDate(String updateDate) {
        this.updateDate = updateDate;
    }
}
